package com.ly.heart.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import com.ly.common.utils.erp.SnowflakeIdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.FollowRecordMapper;
import com.ly.heart.domain.FollowRecordEntity;
import com.ly.heart.service.IFollowRecordService;

/**
 * 客户跟进记录Service业务层处理
 *
 * @author cxl
 * @date 2024-05-14
 */
@Service
public class FollowRecordEntityServiceImpl extends ServiceImpl<FollowRecordMapper,FollowRecordEntity> implements IFollowRecordService
{
    @Autowired
    private FollowRecordMapper followRecordMapper;

    /**
     * 查询客户跟进记录
     *
     * @param id 客户跟进记录主键
     * @return 客户跟进记录
     */
    @Override
    public FollowRecordEntity selectFollowRecordEntityById(String id)
    {
        return followRecordMapper.selectFollowRecordEntityById(id);
    }

    /**
     * 查询客户跟进记录列表
     *
     * @param followRecordEntity 客户跟进记录
     * @return 客户跟进记录
     */
    @Override
    public List<FollowRecordEntity> selectFollowRecordEntityList(FollowRecordEntity followRecordEntity)
    {
        return followRecordMapper.selectFollowRecordEntityList(followRecordEntity);
    }

    /**
     * 新增客户跟进记录
     *
     * @param followRecordEntity 客户跟进记录
     * @return 结果
     */
    @Override
    public int insertFollowRecordEntity(FollowRecordEntity followRecordEntity)
    {
        followRecordEntity.setId(SnowflakeIdWorker.getInstance().nextStringId());
        followRecordEntity.setCreateTime(DateUtils.getNowDate());
        return followRecordMapper.insertFollowRecordEntity(followRecordEntity);
    }

    /**
     * 修改客户跟进记录
     *
     * @param followRecordEntity 客户跟进记录
     * @return 结果
     */
    @Override
    public int updateFollowRecordEntity(FollowRecordEntity followRecordEntity)
    {
        return followRecordMapper.updateFollowRecordEntity(followRecordEntity);
    }

    /**
     * 批量删除客户跟进记录
     *
     * @param ids 需要删除的客户跟进记录主键
     * @return 结果
     */
    @Override
    public int deleteFollowRecordEntityByIds(String[] ids)
    {
        return followRecordMapper.deleteFollowRecordEntityByIds(ids);
    }

    /**
     * 删除客户跟进记录信息
     *
     * @param id 客户跟进记录主键
     * @return 结果
     */
    @Override
    public int deleteFollowRecordEntityById(String id)
    {
        return followRecordMapper.deleteFollowRecordEntityById(id);
    }
}
